Skip to content

apt_dpkg: refactorings for contents cache#594

Open
bdrung wants to merge 3 commits intocanonical:mainfrom
bdrung:contents-mapping-refactor
Open

apt_dpkg: refactorings for contents cache#594
bdrung wants to merge 3 commits intocanonical:mainfrom
bdrung:contents-mapping-refactor

Conversation

@bdrung
Copy link
Copy Markdown
Member

@bdrung bdrung commented Apr 22, 2026

These refactorings are preparation for following commits:

  • apt_dpkg: use pathlib.Path for mapping_file
  • apt_dpkg: call _contents_mapping() outside of pocket loop
  • apt_dpkg: move saving contents cache to _get_file2pkg_mapping

bdrung added 3 commits April 22, 2026 15:46
Modernize the code by using `pathlib.Path` for `mapping_file`.
`_contents_mapping()` loads the cached content mapping. Calling it
multiple times in `_get_file2pkg_mapping` is not needed.

Call `_contents_mapping()` before looping over the different pockets of
the release.
Move saving the changed contents cache into `_get_file2pkg_mapping`
where this contents cache is updated. This improves code locality.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.44%. Comparing base (5beb93d) to head (1679803).

Files with missing lines Patch % Lines
apport/packaging_impl/apt_dpkg.py 87.50% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #594      +/-   ##
==========================================
- Coverage   84.45%   84.44%   -0.01%     
==========================================
  Files         104      104              
  Lines       20939    20938       -1     
  Branches     3212     3210       -2     
==========================================
- Hits        17683    17682       -1     
  Misses       2815     2815              
  Partials      441      441              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant